
<html >
    <head>
    <meta charset="utf-8">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache">
<META HTTP-EQUIV="Expires" CONTENT="0">
<link href="/static/new_ui/css/base.css" rel="stylesheet" type="text/css" />
<link href="/static/libs/easyui/themes/default/easyui.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" type="text/css" href="/static/new_ui/new_css/bootstrap.css">
<link rel="stylesheet" type="text/css" href="/static/new_ui/new_css/base_v3.0.css">
<link href="http://ui.fcstatic.naryou.cn/static/libs/easyui/themes/icon.css" rel="stylesheet" type="text/css" />
<link  style="width:16px; height=16px;" rel="shortcut icon" href="/static/new_ui/images/logo_s.png">
<script type="text/javascript" src="/static/new_ui/new_js/jquery.js"></script>
<script type="text/javascript" src="/static/libs/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="http://ui.fcstatic.naryou.cn/static/libs/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="/static/libs/util.js"></script>
<script type="text/javascript" src="/static/food/common.js"></script>
<script type="text/javascript" src="/static/libs/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/libs/jquery.json-2.4.min.js"></script>
<script type="text/javascript" src="/static/new_ui/new_js/base_v3.0.js"></script>
<script type="text/javascript" src="/static/new_ui/new_js/bootstrap.min.js"></script>
<link rel="stylesheet" href="/static/new_ui/css/base.css" type="text/css" />
<link rel="stylesheet" href="/static/new_ui/css/house-v1.6.css" type="text/css" />
<style type="text/css">
</style>
</head>
<body>
<div class="container-fluid warp tops">
    <div class="row-fluid">
        
        <div id="myCustom" class="tab-content" style="overflow: hidden">
            <div class="tab-pane fade in active" id="dairenzheng">
                <div class="right-btn">
                    
                </div>
                <div class="wrapper" style="padding-top: 30px;">
                    <!--content-->
                    <div class="content-box  clearfix">
                        <!--left-content-->
                        <div class="influ-left-box" style="min-height: 1000px;">
                            <a href="javascript:void(0)" onclick="reloadPage('243511')">
                                <img class="influ-left-logo" src="http://oldimg.fcstatic.naryou.cn/images/default/avatar.png" width="83%" alt="" />
                                
                            </a>
                            <!---green-string-->
                            <div class="client-box-top none"></div>
                            <!--client-box-box  页面来源于佣金列表时才会有levelInfluenceDtoList值-->
                            <div class="client-box-box" style="top:180px">
                                
                                <div class="left-client-parent"></div>
                                <!--在client-box-box的div里面始终留该div用于移动定位-->
                            </div>
                        </div>
                        <!--right-content-->
                        <div class="influ-right-box clearfix">
                            <!--right-content-top-->
                            <div class="influ-rig-top">
                                <span style="font-size: 22px;color: #3f4250;margin-left:6px"><%= mydata.remarkName%> </span>
                                <span style="font-size:14px;margin-left:5px;color: #3f4250;"><%= mydata.mobile%></span>
                                <input id="rootMemberId" name="rootMemberId" value="243511" type="hidden" />
                                <ul class="influ-rig-info">
                                    <li><span class="rig-info-one">影响的前1层客户:</span> <span class="rig-info-peo"><%= newdata.length %>人</span> </li>
                                    
                            </ul>
                        </div>
                        <!--influence-people-data-first-floor-->
                        <div class="people-data-box first-floor">
                            
                            <p class="people-data-text"><%= mydata.remarkName%>  第<span id="level">一</span>层影响的客户:
                        </p>
                        
                        <!--client-server-->
                        <ul class="people-data-num" id="people-data-num">
                            <% newdata.forEach(function (node, index) { %>
                                <li class="click-li">
                                    <div onclick="searchInfluenceMember('245740');" style="width: 75px">
                                        <div class="data-info-box">            
                                            <img src="http://oldimg.fcstatic.naryou.cn/images/default/avatar.png" alt="" />            
                                        </div>
                                        <span class="data-info-name"><%= node.remarkName %></span>        
                                        <div class="data-info-round">1</div>      
                                        <span class='button-min bg-green' style="visibility: hidden">已成交</span>    
                                        <!--popup-->
                                        <div class="info-popup-box">
                                            <img class="popup-img" src="/static/new_ui/img/houseImg/icon-left.png" alt="" />
                                            <p class="pop-name"><%= node.remarkName %></p>
                                            <!--client-info-->
                                            <ul class="pop-client-info">                
                                                <li><span class="pop-info-one">推荐人:</span><span class="pop-info-two"><%= mydata.remarkName %></span></li>
                                            </ul>
                                            <!--client-benefit-->
                                            <ul class="pop-client-info">                
                                                <li><span class="pop-info-one">影响的客户:</span><span class="pop-info-num">1人</span></li>
                                            </ul>
                                            <!--person-info-->
                                            <ul class="pop-client-info">
                                                <li><span class="pop-info-one">电话:</span><span class="pop-info-two"><%= node.mobile %></span></li>
                                                <li><span class="pop-info-one">来源:</span><span class="pop-info-two">微信</span></li>
                                                <li><span class="pop-info-one">注册时间:</span><span class="pop-info-two"><%= node.time %></span></li>
                                            </ul>
                                           
                                        </div>
                                    </div>
                                </li>
                            <% }) %>
                        </ul>
                    </div>
                </div>
                <div style="clear: both"></div>
                <div style="position: absolute; right: 0; margin-top: 5px;top:990px;z-index:999">
                    <div class="leftContent-data-jump" style="margin-top: 0;">
                        <input type="hidden" id="toPage" value="1" /> <a href="javascript:prePage()">上一页</a><span id="currentPage">1</span>/<span id="totalPage">1</span><a
                        href="javascript:nextPage()">下一页</a> <input type="text" class="data-jump-Pages" onkeyup="value=value.replace(/[^\d]/g,'')" id="toPageTxt" value="1"> <input
                        type="button" value="跳转" class="data-jump-skip" onclick="toPageMethod()" style="line-height: 23px;"> <input type="hidden" id="currentId"
                        value="243511">
                    </div>
                    <div style="clear: both;"></div>
                    
                    <div id="JS_mask" style="position: absolute; left: 0px; top: 0px; background-color: #000; z-index: 99; opacity: 0.1; filter: alpha(opacity = 10); display: none;"></div>
                </div>
            </div>
        </div>
    </div>
</div>
</div>
</div>
<!--body-->
<script type="text/javascript" src="/static/new_ui/js/dateinput.js"></script>
<script type="text/javascript">
//绿色线的高度等于他父亲元素的高度
$(function(){
var size =  0;
if(size>0){
$(".client-box-top").removeClass("none");
$(".data-info-box").css({border:"none"});
$(".data-info-box").last().css({border:"solid 1px #3ec526"});
}
$(".left-client-icon").hide();
$(".left-client-icon").last().show();
if(size>=6){
$(".people-data-text").hide();
}
//        var imgHeight=$(".influ-left-box").css("min-height");
//        imgHeight = parseInt(imgHeight);
//        alert(imgHeight);
//        $(".client-box-top ").css("height",imgHeight+'px');
$(".client-box-top ").css({height:"870px"});
});
//点击右边客户移动到左边
$(function(){
$("#level_num").val(1);
$(".people-data-box").find(".click-li").live('click',function(){
var liX = $(this).offset().left;
var liY = $(this).offset().top;
var leCus = $("div.left-client-parent:last-child");
var leCusX=leCus.offset().left;
var leCusY=leCus.offset().top;
var numX=leCusX-liX;//计算移动距离
var numY=leCusY-liY;
var perContent=$(this).html();
var addiv='<div class="left-client-parent" onmousemove=hover1();>'+perContent+'<div class="left-client-icon"></div></div>';
$(".left-client-parent").removeClass("none");
$(this).find(".info-popup-box").addClass("none");
$(this).animate({left:numX,top:numY},function(){
alert(1);
},function(){
$(".client-box-top").removeClass("none");
$(this).remove();
$(".left-client-icon").addClass("none");
$(".left-client-parent .data-info-box").find("img").css({border:"none"});//隐藏边框
leCus.before(addiv);//把点击的节点添加到左边显示
var del=$(".client-box-box").find(".info-popup-box");
del.hide();
}).off();
});
});
//   弹出左边头像信息
function hover1(){
$(".left-client-parent").hover(function(){
var _this = $(this);                    // 把$(this)对象赋给一个变量
//var thisfind=$(".left-client-parent").find(".info-popup-box");
trigger = setTimeout(function(){
_this.find(".info-popup-box").css({display:"block"});// jQuery的setTimeout中不能直接使用$(this)
});                                 // 延迟时间0.2秒
}, function(){
clearTimeout(trigger);                  // 清除上面的延迟触发的事件
$(this).find(".info-popup-box").css({display:"none"});
});
}
//点击坐标头像清除
$(function(){
$(".left-client-parent").live('click',function(){
$(this).nextAll('div').remove();
var leCus = $("div.left-client-parent:last-child");
var addiv='<div class="left-client-parent"></div>';
leCus.after(addiv);//把点击的节点添加到左边显示
$(".left-client-icon").last().show();
$(this).find(".left-client-icon").removeClass("none");
$(this).find(".data-info-box").find("img").css({border:"1px solid #3ec526"});
})
});
//每个收到影响客户的弹出信息
$(function(){
hover();
});
function hover(){
$(".people-data-num>li").hover(function(){
var _this = $(this);                    // 把$(this)对象赋给一个变量
trigger = setTimeout(function(){
_this.find(".info-popup-box").css({display:"block"});// jQuery的setTimeout中不能直接使用$(this)
},500);                                 // 延迟时间0.2秒
}, function(){
clearTimeout(trigger);                  // 清除上面的延迟触发的事件
$(this).find(".info-popup-box").css({display:"none"});
});
}
/*
* 解决页数问题，每次点击头像查询影响客户时应该默认跳至第一页
* */
function searchInfluenceMember(currentMemberId){
$(".people-data-text").show();
$("#toPage").val(1);
showInfluenceMember(currentMemberId);
}
/*
* 查找某一层影响客户，并拼接替换原有数据
* $("#people-data-num").empty(); $("#people-data-num").append(html);
* */
function showInfluenceMember(currentMemberId){
$("#currentId").val(currentMemberId);
var toPage = $("#toPage").val();
var rootMemberId = $("#rootMemberId").val();
var url = '/merse/consumer/myinfluence/showLevel';
$.ajax({
url:url,
type:'get',
data:$.param({rootMemberId:rootMemberId,currentMemberId:currentMemberId,currentPage:toPage},true),
success:(function(json){
$("#people-data-num").empty();
var members = json.dtoList;
var html = '';
var level = "1";
for(var i in members){
var dto=members[i];
level = dto.level;
if(dto.influenceNo>0){
html += '<li class="click-li">';
html += '<div style="width: 75px" onclick="searchInfluenceMember('+dto.memberId+')">';
}else{
html += '<li>';
    html += '<div style="width: 75px">';
        }
        html += '<div class="data-info-box">';
            if(dto.customerImageUrl!=null){
            html +=  '<img src="'+dto.customerImageUrl+'" alt=""/>';
            }else{
            html += '<img src="/static/new_ui/img/house_2.3/Consumer2.png" alt=""/>';
            }
        html += '</div>';
        html += '<span class="data-info-name">'+dto.name+'</span>';
        if(dto.influenceNo>0){
        if(dto.influenceNo<100){
        if(dto.influenceDealNo>0){
        html += '<div class="info-left-num">'+dto.influenceNo+'</div>';
        }else{
        html += '<div class="data-info-round">'+dto.influenceNo+'</div>';
        }
        }else{
        if(dto.influenceDealNo>0){
        html += '<div class="info-left-num">99<sup style="vertical-align: middle">+</sup></div>';
        }else{
        html += '<div class="data-info-round">99<sup style="vertical-align: middle">+</sup></div>';
        }
        }
        }
        if(dto.influenceDealNo>0){
        html += '<div class="info-right-num">'+dto.influenceDealNo+'</div>'
        }
        if(dto.deal==true){
        html += '<span class="button-min bg-green">已成交</span>';
        }else{
        html += '<span class="button-min bg-green" style="visibility: hidden">已成交</span>';
        }
        //用户详情内容-start
        html += '<div class="info-popup-box">';
            html += '<img class="popup-img" src="/static/new_ui/img/houseImg/icon-left.png" alt=""/>';
            html += '<p class="pop-name">'+dto.name+'</p>';
            html += '<ul class="pop-client-info">';
                if(dto.customerInfoDto.consultantName !=  null){
                html += '<li><span class="pop-info-one">所属置业顾问:</span><span class="pop-info-two">'+dto.customerInfoDto.consultantName+'</span></li>';
                }
                var sellDtos = dto.customerInfoDto.sellingDtos;
                if(sellDtos != null){
                for(var j in sellDtos){
                var sellDto = sellDtos[j];
                html += '<li><span class="pop-info-one">购买房源:</span>';
                if(sellDto.buildingNo != null){
                html += '<span class="pop-info-two">'+sellDto.buildingNo+'</span>';
                }
            html += '</li>';
            html += '<li><span class="pop-info-one">购买时间:</span>';
            if(sellDto.dealDate != null){
            html += '<span class="pop-info-two">'+sellDto.dealDate+'</span>';
            }
        html += '</li>';
        }
        }
    html += '</ul>';
    html += '<ul class="pop-client-info">';
        if(dto.influenceNo>0){
        html += '<li><span class="pop-info-one">影响的客户:</span><span class="pop-info-num">'+dto.influenceNo+'人</span></li>';
        }
        if(dto.influenceDealNo>0){
        html += '<li><span class="pop-info-one">影响的成交客户:</span><span class="pop-info-num2">'+dto.influenceDealNo+'人</span></li>';
        }
        if(dto.customerInfoDto.money!=null && dto.customerInfoDto.money>0){
        html += '<li><span class="pop-info-one">带来佣金:</span><span class="class="pop-info-num3">'+dto.customerInfoDto.money+'</span></li>';
        }
    html += '</ul>';
    html += '<ul class="pop-client-info">';
        html += '<li><span class="pop-info-one">电话:</span><span class="pop-info-two">'+dto.customerInfoDto.mobile+'</span></li>';
        html += '<li><span class="pop-info-one">来源:</span><span class="pop-info-two">'+dto.customerInfoDto.shareSource+'</span></li>';
        html += '<li><span class="pop-info-one">注册时间:</span><span class="pop-info-two">'+dto.customerInfoDto.registerDate+'</span></li>';
    html += '</ul>';
    html += '<a class="check-more-link"  onclick="openShowProList('+dto.memberId+')" href="javascript:void(0)">查看客户详情 <img src="/static/new_ui/img/house_2.3/icon-right.png" alt=""/></a>';
html += '</div>';
//用户详情内容-end
html += '</div>';
html +='</li>';
}
$("#people-data-num").append(html);
showLi();
changeLevel(level);
hover();
$("#totalPage").html(json.pagination.pageCount);
if(json.pagination.pageCount == 0){
$("#currentPage").html(0);
} else {
$("#currentPage").html(json.pagination.currentPage);
}
$("#toPage").val(json.pagination.currentPage);
$("#toPageTxt").val(json.pagination.currentPage);
})
});
}
/* 上一页 */
function prePage(){
var currentId = $("#currentId").val();
var currentPage = $("#currentPage").html();
var current = parseInt(currentPage);
if(current > 1){
current = current - 1;
} else {
return;
}
$("#toPage").val(current);
showInfluenceMember(currentId);
}
/* 下一页 */
function nextPage(){
var currentId = $("#currentId").val();
var currentPage = $("#currentPage").html();
var current = parseInt(currentPage);
var totalPage = $("#totalPage").html();
var total = parseInt(totalPage);
if(current < total){
current = current + 1;
} else {
return;
}
$("#toPage").val(current);
showInfluenceMember(currentId);
}
/* 跳转到页 */
function toPageMethod(){
var currentId = $("#currentId").val();
var toPageNum = $("#toPageTxt").val();
var totalPage = $("#totalPage").html();
var pageNum = parseInt(toPageNum);
var pageTotalNum = parseInt(totalPage);
if(pageNum > pageTotalNum){
pageNum = pageTotalNum;
}
$("#toPage").val(pageNum);
showInfluenceMember(currentId);
}
/*
* 显示第几层
* */
function changeLevel(numStr){
var num = parseInt(numStr);
if(num==1){
$("#level").html("一")
}
if(num==2){
$("#level").html("二")
}
if(num==3){
$("#level").html("三")
}
if(num==4){
$("#level").html("四")
}
if(num==5){
$("#level").html("五")
}
}
/*
重新加载该页面，显示用户第一层级
* */
function reloadPage(memberId){
window.location.href='/merse/consumer/myinfluence/' + memberId + '/';
}
/*
打开客户影响层级页面
* */
function openShowProList(memberId){
window.parent.location.href="/merse/consumer/detail/"+ memberId + "/1";
var e=arguments.callee.caller.arguments[0]||event;
stopDefault(e);
}
//    function openShowProList(memberId){
//        var rootId = $("#rootMemberId").val();
//        window.open("/merse/consumer/myinfluence/" + rootId + "/"+memberId+"/");
//        return false;
//    }
//加载出现头像动画
var showLi=function(){
var i=0;
$('.people-data-num>li').hide();
function show(){
if(i !=  $('.people-data-num>li').size()){
$('.people-data-num>li').eq(i++).fadeIn(100);
setTimeout(show,100);
}
}
setTimeout(show,100);
}
function stopDefault(e) {
if(e&&e.stopPropagation){//非IE
e.stopPropagation();
}
else{//IE
window.event.cancelBubble=true;
}
}
</script>
</body>
</html>